
$(document).ready(function(){
	
	var askingPriceId = getQueryParamValue("askingPriceId");
	var rootPath = getRootPath();
	
	
	$.ajax({
		method : 'get',
		url : rootPath+'/wechat/api/askingPrice/selectPrice/id?askingPriceId='+askingPriceId,
		error:function(XMLHttpRequest, ajaxOptions, thrownError){
			alert("连接服务器错误!");
		},
		success : function(resultData){
			
			var wholeHtml = '';
			
			$.each(resultData,function(askingpriceIndex,askingpriceObj){
				
				var askingpriceHtml = '';

				var askingPriceStatus = '';
				
				if(askingpriceObj.askingPriceStatus==10011001){
					askingPriceStatus = '已报价';
					
					askingpriceHtml = askingpriceHtml + '<div class="panel panel-default">'
					  								  +   '<ul class="list-group">'
					  								  +     '<li class="list-group-item">询价车型：'+askingpriceObj.packageCodeName+'</li>'
					  								  +		'<li class="list-group-item">'
					  								  +		  '<span>车型颜色：</span><br><br>'
					  								  +		  '<span>联&nbsp;系&nbsp;人：'+askingpriceObj.potentialUserId+'</span><br><br>'
					  								  +		  '<span>手机号码：'+askingpriceObj.phone+'</span><br><br>'
					  								  +		  '<span>询价时间：'+askingpriceObj.createDate+'</span><br>'
					  								  +		 '</li>'
					  								  +    '</ul>'
					  								  + '</div>'
					  								  + '<div class="panel panel-default">'
					  								  +   '<ul class="list-group">'
					  								  +     '<li class="list-group-item">'
					  								  +		  '询价状态：<span style="color:blue">'+askingPriceStatus+'</span><br><br>'
					  								  +		  '<span>我们将以最快速度为您安排，请稍作等候。</span><br><br>'
					  								  +		  '<span>销售报价：<br>您好，我们的最低报价是：96.3万，如有需求，请及时与我们联系</span><br><br>'
					  								  +		  '<p>您的专属销售顾问：'+askingpriceObj.saName+'</p>'
					  								  +		'</li>'
					  								  +    '</ul>'
					  								  + '</div>'
				}
				else if(askingpriceObj.askingPriceStatus==10011002){
					askingPriceStatus = '受理中';
					
					askingpriceHtml = askingpriceHtml + '<div class="panel panel-default">'
					  +   '<ul class="list-group">'
					  +     '<li class="list-group-item">询价车型：'+askingpriceObj.packageCodeName+'</li>'
					  +		'<li class="list-group-item">'
					  +		  '<span>车型颜色：</span><br><br>'
					  +		  '<span>联&nbsp;系&nbsp;人：'+askingpriceObj.potentialUserId+'</span><br><br>'
					  +		  '<span>手机号码：'+askingpriceObj.phone+'</span><br><br>'
					  +		  '<span>询价时间：'+askingpriceObj.createDate+'</span><br>'
					  +		 '</li>'
					  +    '</ul>'
					  + '</div>'
					  + '<div class="panel panel-default">'
					  +   '<ul class="list-group">'
					  +     '<li class="list-group-item">'
					  +		  '询价状态：<span style="color:red">'+askingPriceStatus+'</span><br><br>'
					  +		  '<span>我们将以最快速度为您安排，请稍作等候。</span><br><br>'
					  +		  '<p>您的专属销售顾问：'+askingpriceObj.saName+'</p>'
					  +		'</li>'
					  +    '</ul>'
					  + '</div>'
					  + '<div class="panel panel-default">'
					  +   '<input style="background-color:gray" type="button" data-toggle="modal" data-target="#myModal"  value="取消询价" class="btn btn-default btn-lg btn-block" />'
					  + '</div>'
				}
				else{
					askingPriceStatus = '取消';
					
					askingpriceHtml = askingpriceHtml + '<div class="panel panel-default">'
					  								  +   '<ul class="list-group">'
					  								  +     '<li class="list-group-item">询价车型：'+askingpriceObj.packageCode+'</li>'
					  								  +		'<li class="list-group-item">'
					  								  +		  '<p>车型颜色：</p>'
					  								  +		  '<p>联&nbsp;系&nbsp;人：'+askingpriceObj.potentialUserId+'</p>'
					  								  +		  '<p>手机号码：'+askingpriceObj.phone+'</p>'
					  								  +		  '<p>询价时间：'+askingpriceObj.createDate+'</p>'
					  								  +		 '</li>'
					  								  +    '</ul>'
					  								  + '</div>'
					  								  + '<div class="panel panel-default">'
					  								  +   '<ul class="list-group">'
					  								  +     '<li class="list-group-item">'
					  								  +		  '<p>询价状态：'+askingPriceStatus+'</p>'
					  								  +		'</li>'
					  								  +    '</ul>'
					  								  + '</div>'
				}				  
				
				wholeHtml += askingpriceHtml;
			});
			
			$("#information").append(wholeHtml);
		}
	});
})
